import { NgModule } from '@angular/core';
import { registerLocaleData } from '@angular/common';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import zh from '@angular/common/locales/zh';

// ng-zorro
import { NZ_I18N } from 'ng-zorro-antd/i18n';
import { zh_CN } from 'ng-zorro-antd/i18n';

// custom
import { AppRoutingModule } from '@/app-routing.module';
import { LayoutModule } from '@/layout/layout.module';
import { AppComponent } from '@/app.component';
import { IconsProviderModule } from '@/icons-provider.module';
import { ExceptionModule } from '@/core/base/exception/exception.module';
import { PassportModule } from '@/core/base/passport/passport.module';
import { DefaultInterceptor } from '@/core/net/interceptor.default';
import { DashboardModule } from '@/pages/dashboard/dashboard.module';
import { ArticleManagementModule } from '@/pages/article-management/article-management.module';
import { UserManagementModule } from '@/pages/user-management/user-management.module';

registerLocaleData(zh);

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    HttpClientModule,
    BrowserAnimationsModule,
    IconsProviderModule,
    LayoutModule,
    ExceptionModule,
    PassportModule,
    DashboardModule,
    ArticleManagementModule,
    AppRoutingModule,
    UserManagementModule,
  ],
  providers: [
    { provide: NZ_I18N, useValue: zh_CN },
    { provide: HTTP_INTERCEPTORS, useClass: DefaultInterceptor, multi: true },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
